package com.putable.nmc.dmv;

import java.io.StringWriter;

import com.putable.nmc.world.World;
import com.putable.pqueue.PQueue;


public class Manager extends Staff {

	private int numReports = 0;
	private World world;
	public Manager(PQueue pq, World world){
		super(pq);
		this.world = world;
		run(0, new CustomerLine());
	}
	/**
	 * Runs on the hour every hour
	 */
	@Override
	public void run(double time, CustomerLine cLine) {
		Report(cLine);
		this.setTimeOfNextTask(time+3600);
		this.getPQueue().insert(this);
	}
	/**
	 * Report a summary of the current overall status of the office
	 * Do this once an hour on the hour
	 */
	public void Report(CustomerLine cLine){
		numReports++;//For testing purposes
		System.out.println("Customers in Line: " + cLine.getSize() + ", Is Passing?: " 
				+ world.getScore(new StringWriter()));
	}

	public int getNumReports(){
		return numReports;
	}
}
